feat: disable auto-upgrade based on environment variable#113
Merged
JohnPhamous merged 1 commit intoApr 11, 2025
Merged
Conversation
Added a check to skip the auto-upgrade process if the environment variable SF_CLI_DISABLE_AUTO_UPGRADE is set. This allows users to control the upgrade behavior of the CLI more effectively.
Contributor
There was a problem hiding this comment.
PR Summary
This PR adds the ability to disable automatic CLI upgrades by checking for the SF_CLI_DISABLE_AUTO_UPGRADE environment variable in the version checking logic.
- Added an early return in
src/checkVersion.tsthat skips version checking when the environment variable is set - This feature is particularly useful for CI/CD pipelines and automated environments where unexpected upgrades could be disruptive
- Maintains backward compatibility as the environment variable is opt-in
- Aligns with existing versioning infrastructure documented in the README's "New Release" section
- Implementation is minimal and focused, only affecting the version checking logic without modifying other CLI behaviors
Greptile AI
1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added a check to skip the auto-upgrade process if the environment variable SF_CLI_DISABLE_AUTO_UPGRADE is set. This allows users to control the upgrade behavior of the CLI more effectively.